home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 206 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.1 KB  |  49 lines

  1. Path: odi.com!usenet
  2. From: Kimberley Burchett <burchett>
  3. Newsgroups: comp.lang.c++
  4. Subject: Duplication of Prototypes
  5. Date: 2 Jan 1996 23:59:02 GMT
  6. Organization: Software Leverage, Inc
  7. Message-ID: <4ccgs6$qnk@mastermind.odi.com>
  8. NNTP-Posting-Host: loon.odi.com
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 1.1N (X11; I; SunOS 4.1.3 sun4c)
  13. X-URL: news:comp.lang.c++
  14.  
  15. Here's what I'm talking about:
  16.  
  17.     class Base
  18.     {
  19.     public:
  20.        virtual void do_something(param list);
  21.     };
  22.  
  23.     class Derived : public Base
  24.     {
  25.     public:
  26.        virtual void do_something(param list);
  27.     };
  28.  
  29.     class Embedded
  30.     {
  31.        Base base;
  32.     public:
  33.        // one-line function calls base.do_something()
  34.        virtual void do_something(param list);
  35.     };
  36.  
  37.   ... now try changing the param list or the return value.
  38. You'll have to change six files (three headers, three sources).  
  39. And if Base turns out to be one of those truly useful classes 
  40. that gets used all over, then woe until you.
  41.  
  42.   Does anybody have any techniques for dealing with this that 
  43. don't involve using a smarter editor?
  44.  
  45. Kimberley
  46.  
  47. please cc any responses to burchett@odi.com
  48.  
  49.